/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.jm.acionista.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author joao
 */
@Entity
@Table(name = "moeda", catalog = "acionista", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "Moeda.findAll", query = "SELECT m FROM Moeda m")})
public class Moeda implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_moeda", nullable = false)
    private Integer idMoeda;
    @Basic(optional = false)
    @Column(name = "nom_moeda", nullable = false, length = 50)
    private String nomMoeda;
    @Basic(optional = false)
    @Column(name = "sigla", nullable = false, length = 20)
    private String sigla;
    @Basic(optional = false)
    @Column(name = "cotacao", nullable = false, precision = 18, scale = 2)
    private BigDecimal cotacao;
    @Basic(optional = false)
    @Column(name = "data_cotacao", nullable = false)
    @Temporal(TemporalType.DATE)
    private Date dataCotacao;

    public Moeda() {
    }

    public Moeda(Integer idMoeda) {
        this.idMoeda = idMoeda;
    }

    public Moeda(Integer idMoeda, String nomMoeda, String sigla, BigDecimal cotacao, Date dataCotacao) {
        this.idMoeda = idMoeda;
        this.nomMoeda = nomMoeda;
        this.sigla = sigla;
        this.cotacao = cotacao;
        this.dataCotacao = dataCotacao;
    }

    public Integer getIdMoeda() {
        return idMoeda;
    }

    public void setIdMoeda(Integer idMoeda) {
        this.idMoeda = idMoeda;
    }

    public String getNomMoeda() {
        return nomMoeda;
    }

    public void setNomMoeda(String nomMoeda) {
        this.nomMoeda = nomMoeda;
    }

    public String getSigla() {
        return sigla;
    }

    public void setSigla(String sigla) {
        this.sigla = sigla;
    }

    public BigDecimal getCotacao() {
        return cotacao;
    }

    public void setCotacao(BigDecimal cotacao) {
        this.cotacao = cotacao;
    }

    public Date getDataCotacao() {
        return dataCotacao;
    }

    public void setDataCotacao(Date dataCotacao) {
        this.dataCotacao = dataCotacao;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idMoeda != null ? idMoeda.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Moeda)) {
            return false;
        }
        Moeda other = (Moeda) object;
        if ((this.idMoeda == null && other.idMoeda != null) || (this.idMoeda != null && !this.idMoeda.equals(other.idMoeda))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.jm.acionista.entity.Moeda[ idMoeda=" + idMoeda + " ]";
    }
    
}
